﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>btable</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="css/btable.css" />
	</head>

	<body style=" background-color: gainsboro;">
		<div style="margin:0px; background-color: white; margin:0 10px;">
			<blockquote class="layui-elem-quote">
				<button type="button" onclick="location.href='/admin/site/add'" class="layui-btn layui-btn-small" id="getAll"><i class="fa fa-plus" aria-hidden="true"></i> 添加</button>
				<form class="layui-form" style="float:right;">
					<div class="layui-form-item" style="margin:0;">
						<label class="layui-form-label">名称</label>
						<div class="layui-input-inline">
							<input type="text" name="name" placeholder="支持模糊查询.." autocomplete="off" class="layui-input">
						</div>
						<div class="layui-form-mid layui-word-aux" style="padding:0;">
							<button lay-filter="search" class="layui-btn" lay-submit><i class="fa fa-search" aria-hidden="true"></i> 查询</button>
						</div>
					</div>
				</form>
			</blockquote>
			<div id="content" style="width: 100%;height: 533px;">
				<div class="btable">
					<table class="layui-table layui-form" lay-even="">
						<thead>
							<tr>
								<th style="width:28px;">序号</th>
								<th data-name="name">标题
								</th>
								<th>价格</th>
								<th>城市</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody class="btable-content">
							<tr>
								<td style="display:none;"><input type="hidden" data-item="id" value="1" data-id="1" name="id"></td>
								<td>1</td>
								<td data-field="name">张三</td>
								<td data-field="createtime">200</td>
								<td data-field="sign">南宁</td>
								<td data-field="id">
									<a href="/detail-1" target="_blank" class="layui-btn layui-btn-normal layui-btn-mini">查看</a>
									<input type="button" value="编辑" data-action="edit" data-id="1" class="layui-btn layui-btn-mini">
									<input type="button" value="删除" data-action="del" data-id="1" class="layui-btn layui-btn-mini layui-btn-danger">
								</td>
							</tr>

						</tbody>
					</table>
					<div data-type="paged" class="btable-paged">
						<div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-0"><span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em>1</em></span>
							<a href="javascript:;" data-page="2">2</a>
							<a href="javascript:;" data-page="3">3</a>
							<a href="javascript:;" data-page="4">4</a>
							<a href="javascript:;" data-page="5">5</a><span>…</span>
							<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="19">末页</a>
							<a href="javascript:;" class="layui-laypage-next" data-page="2">下一页</a><span class="layui-laypage-total">到第 <input type="number" min="1" onkeyup="this.value=this.value.replace(/\D/, '');" value="1" class="layui-laypage-skip"> 页 <button type="button" class="layui-laypage-btn">确定</button></span></div>
					</div>
				</div>
			</div>
		</div>

		<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script type="text/javascript" src="/js/jquery.min.js"></script>
		<script>
			$.ajax({
				url: '/product/findtype',
				data: {
					type: '场地',
					page: 1,
					size: 10,
				},
				type: 'get',
				dataType: 'json',
				success: function(response) {

					if(response.code == 200) {
						for(var i = 0; i < response.result.length; i++) {
							var html = '<tr>' +
								'<td style="display:none;"><input type="hidden" data-item="id" value="1" data-id="1" name="id"></td>' +
								'<td>1</td>' +
								'<td data-field="name">' + response.result[i].title + '</td>' +
								'<td data-field="createtime">' + response.result[i].value + '</td>' +
								'<td data-field="sign">' + response.result[i].city + '</td>' +
								'<td data-field="id">' +
								'<a href="/detail-1" target="_blank" class="layui-btn layui-btn-normal layui-btn-mini">查看</a>' +
								'<input type="button" value="编辑" data-action="edit" data-id="1" class="layui-btn layui-btn-mini">' +
								'<input type="button" value="删除" data-action="del" data-id="1" class="layui-btn layui-btn-mini layui-btn-danger">' +
								'</td>' +
								'</tr>';
							$(".btable-content").append(html);
						}
					}

				}
			
			});
		</script>
	</body>

</html>